package com.heima.common.exception;


import com.heima.model.common.enums.AppHttpCodeEnum;

/**
 * 可预知处理异常类
 * @author zhuangzhiwen
 */
public class CustomException extends RuntimeException{

    //定义一个枚举类型的变量
    private AppHttpCodeEnum appHttpCodeEnum;


    /**
     * 构造方法，参数类型为枚举类
     * @param appHttpCodeEnum
     */
    public CustomException(AppHttpCodeEnum appHttpCodeEnum){
        this.appHttpCodeEnum = appHttpCodeEnum;
    }


    /**
     * 自定义处理异常信息
     * @return
     */
    public AppHttpCodeEnum getAppHttpCodeEnum(){
        return appHttpCodeEnum;
    }

}
